<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="root" value="${pageContext.request.contextPath}"/>

<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<title>Lowin</title>
	<link rel="stylesheet" href="${root}/static/css/auth.css">
</head>

<body>
	<div class="lowin">
		<div class="lowin-brand">
			<img src="${root}/static/images/kodinger.jpg" alt="logo">
		</div>
		<div class="lowin-wrapper">

			<div class="lowin-box lowin-login">
				<div class="lowin-box-inner">
					<form id="myform" autocomplete="off" >
						<p>用户登录</p>
						<div> <span style="color: red"> ${msg}</span> </div>
						<div> <span style="color: red" id="nameMsg"></span> </div>
						<div class="lowin-group">
							<label>用户名 <a href="#" class="login-back-link">Sign in?</a></label>
							<input type="text" autocomplete="email" name="username" class="lowin-input" id="username">
						</div>
						<div class="lowin-group password-group">
							<label>密码 <a href="#" class="forgot-link">Forgot Password?</a></label>
							<input type="password" name="password" autocomplete="current-password" class="lowin-input" id="password">
						</div>
						<button type="button" class="lowin-btn" onclick=" return userLogin()">
							登录
						</button>


						<div class="text-foot">
							Don't have an account? <a href="" class="register-link">Register</a>
						</div>
					</form>
				</div>
			</div>

		</div>
	
		<footer class="lowin-footer">
			Design By @itskodinger. More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>
		</footer>
	</div>

	<script src="${root}/static/js/authx.js"></script>--%>
	<script src="${root}/static/jquery/jquery-2.2.4.min.js"></script>
	<script>
		/*设置提交在地址*/
		Authx.init({
			login_url:'${root}/loginServlet',
			forgot_url: '#forgot'
		});

		/*提交*/
		function userLogin() {
           var username = $("#username").val().trim();
           var password = $("#password").val().trim();
           alert(username+"mm");

			if (username!=""){
				if (password!=""){
					$("#myform").submit();
				} else {
					var nameMsg = $("#nameMsg").html("密码不能为空！");
					return  ;
				}
			}else {
				var nameMsg = $("#nameMsg").html("用户名不能为空！");
				return ;
			}

		}
	</script>
</body>
</html>